import { createApp } from 'vue'
import App from './App.vue'
import 'uno.css'
import { createPinia } from "pinia";
import ElementPlus from "element-plus";
import router from "@/router"
import dayjs from "dayjs";
import '@/styles/chat.css'
import 'animate.css/animate.min.css'
import 'element-plus/dist/index.css'
import '@/styles/font.scss'
import '@/styles/index.scss'
import '@/styles/chat.scss'
import "@/styles/layout.scss"
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const app = createApp(App)
app.config.globalProperties.dateAllDesc = function (data: string | number | Date | dayjs.Dayjs | null | undefined) {
  // 转时间戳
  return data ? dayjs(data).format("YYYY-MM-DD HH:mm:ss") : "";
};


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(createPinia());
app.use(ElementPlus, {
  locale: zhCn
});
app.use(router);
router.isReady().then(() => {
  app.mount('#app')
})

